<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Collection class</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="mysql-xdevapi-client.getsession.html">« Client::getClient</a></li>
      <li style="float: right;"><a href="mysql-xdevapi-collection.add.html">Collection::add »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="book.mysql-xdevapi.html">Mysql_xdevapi</a></li>
    <li>Collection class</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="class.mysql-xdevapi-collection" class="reference">

 <h1 class="title">Collection class</h1>
 

 <div class="partintro"><p class="verinfo">(PECL mysql-xdevapi &gt;= 8.0.11)</p>


  <div class="section" id="mysql-xdevapi-collection.intro">
   <h2 class="title">简介</h2>
   <p class="para">

   </p>
  </div>


  <div class="section" id="mysql-xdevapi-collection.synopsis">
   <h2 class="title">类摘要</h2>


   <div class="classsynopsis">
    <div class="ooclass"></div>


    <div class="classsynopsisinfo">
     <span class="ooclass">
      <span class="modifier">class</span> <strong class="classname">mysql_xdevapi\Collection</strong>
     </span>
     
     <span class="oointerface"><span class="modifier">implements</span> 
       <a href="class.mysql-xdevapi-schemaobject.html" class="interfacename">mysql_xdevapi\SchemaObject</a></span> {</div>

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 属性 */</div>
    <div class="fieldsynopsis">
     <span class="modifier">public</span>
      <var class="varname"><a href="class.mysql-xdevapi-collection.html#mysql-xdevapi-collection.props.name">$<var class="varname">name</var></a></var>;</div>


    
    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 方法 */</div>
    <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>add</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.declarations.html#language.types.declarations.mixed" class="type mixed">mixed</a></span> <code class="parameter">$document</code></span>): <span class="type"><a href="class.mysql-xdevapi-collectionadd.html" class="type mysql_xdevapi\CollectionAdd">mysql_xdevapi\CollectionAdd</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><strong>addOrReplaceOne</strong></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$id</code></span>, <span class="methodparam"><span class="type">string</span> <code class="parameter">$doc</code></span>): <span class="type"><a href="class.mysql-xdevapi-result.html" class="type mysql_xdevapi\Result">mysql_xdevapi\Result</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><strong>count</strong></span>(): <span class="type">int</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><strong>createIndex</strong></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$index_name</code></span>, <span class="methodparam"><span class="type">string</span> <code class="parameter">$index_desc_json</code></span>): <span class="type"><span class="type void">void</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><strong>dropIndex</strong></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$index_name</code></span>): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><strong>existsInDatabase</strong></span>(): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><strong>find</strong></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$search_condition</code><span class="initializer"> = ?</span></span>): <span class="type"><a href="class.mysql-xdevapi-collectionfind.html" class="type mysql_xdevapi\CollectionFind">mysql_xdevapi\CollectionFind</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><strong>getName</strong></span>(): <span class="type">string</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><strong>getOne</strong></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$id</code></span>): <span class="type"><span class="type Document">Document</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><strong>getSchema</strong></span>(): <span class="type"><span class="type Schema Object">Schema Object</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><strong>getSession</strong></span>(): <span class="type"><span class="type Session">Session</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><strong>modify</strong></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$search_condition</code></span>): <span class="type"><a href="class.mysql-xdevapi-collectionmodify.html" class="type mysql_xdevapi\CollectionModify">mysql_xdevapi\CollectionModify</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><strong>remove</strong></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$search_condition</code></span>): <span class="type"><a href="class.mysql-xdevapi-collectionremove.html" class="type mysql_xdevapi\CollectionRemove">mysql_xdevapi\CollectionRemove</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><strong>removeOne</strong></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$id</code></span>): <span class="type"><a href="class.mysql-xdevapi-result.html" class="type mysql_xdevapi\Result">mysql_xdevapi\Result</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><strong>replaceOne</strong></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$id</code></span>, <span class="methodparam"><span class="type">string</span> <code class="parameter">$doc</code></span>): <span class="type"><a href="class.mysql-xdevapi-result.html" class="type mysql_xdevapi\Result">mysql_xdevapi\Result</a></span></div>

   }</div>


  </div>

  

  <div class="section" id="mysql-xdevapi-collection.props">
   <h2 class="title">属性</h2>
   <dl>
    
     <dt id="mysql-xdevapi-collection.props.name"><var class="varname">name</var></dt>

     <dd>

      <p class="para"/>
     </dd>

    
   </dl>

  </div>



 </div>

 

















































































































<h2>目录</h2><ul class="chunklist chunklist_reference"><li><a href="mysql-xdevapi-collection.add.html">Collection::add</a> — Add collection document</li><li><a href="mysql-xdevapi-collection.addorreplaceone.html">Collection::addOrReplaceOne</a> — Add or replace collection document</li><li><a href="mysql-xdevapi-collection.construct.html">Collection::__construct</a> — Collection constructor</li><li><a href="mysql-xdevapi-collection.count.html">Collection::count</a> — Get document count</li><li><a href="mysql-xdevapi-collection.createindex.html">Collection::createIndex</a> — Create collection index</li><li><a href="mysql-xdevapi-collection.dropindex.html">Collection::dropIndex</a> — Drop collection index</li><li><a href="mysql-xdevapi-collection.existsindatabase.html">Collection::existsInDatabase</a> — Check if collection exists in database</li><li><a href="mysql-xdevapi-collection.find.html">Collection::find</a> — Search for document</li><li><a href="mysql-xdevapi-collection.getname.html">Collection::getName</a> — Get collection name</li><li><a href="mysql-xdevapi-collection.getone.html">Collection::getOne</a> — Get one document</li><li><a href="mysql-xdevapi-collection.getschema.html">Collection::getSchema</a> — Get schema object</li><li><a href="mysql-xdevapi-collection.getsession.html">Collection::getSession</a> — Get session object</li><li><a href="mysql-xdevapi-collection.modify.html">Collection::modify</a> — Modify collection documents</li><li><a href="mysql-xdevapi-collection.remove.html">Collection::remove</a> — Remove collection documents</li><li><a href="mysql-xdevapi-collection.removeone.html">Collection::removeOne</a> — Remove one collection document</li><li><a href="mysql-xdevapi-collection.replaceone.html">Collection::replaceOne</a> — Replace one collection document</li></ul>
</div>
</div></div></body></html>